import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/index/models/expenditure_progress_entity.dart';

ExpenditureProgressEntity $ExpenditureProgressEntityFromJson(
    Map<String, dynamic> json) {
  final ExpenditureProgressEntity idEntity = ExpenditureProgressEntity();
  final String? total_amt =
      jsonConvert.convert<String>(json['total_amt']);
  if (total_amt != null) {
    idEntity.total_amt = total_amt;
  }
  final String? amount =
      jsonConvert.convert<String>(json['amount']);
  if (amount != null) {
    idEntity.amount = amount;
  }
  final String? amt1 =
      jsonConvert.convert<String>(json['amt1']);
  if (amt1 != null) {
    idEntity.amt1 = amt1;
  }
  final String? amt3 =
      jsonConvert.convert<String>(json['amt3']);
  if (amt3 != null) {
    idEntity.amt3 = amt3;
  }
  final String? amt2 = jsonConvert.convert<String>(json['amt2']);
  if (amt2 != null) {
    idEntity.amt2 = amt2;
  }
  final String? agency_name = jsonConvert.convert<String>(json['agency_name']);
  if (agency_name != null) {
    idEntity.agency_name = agency_name;
  }
  final String? cur_amt = jsonConvert.convert<String>(json['cur_amt']);
  if (cur_amt != null) {
    idEntity.cur_amt = cur_amt;
  }
  final String? fiscal_year = jsonConvert.convert<String>(json['fiscal_year']);
  if (fiscal_year != null) {
    idEntity.fiscal_year = fiscal_year;
  }
  return idEntity;
}

Map<String, dynamic> $ExpenditureProgressEntityToJson(
    ExpenditureProgressEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total_amt'] = entity.total_amt;
  data['amount'] = entity.amount;
  data['amt1'] = entity.amt1;
  data['amt3'] = entity.amt3;
  data['amt2'] = entity.amt2;
  data['agency_name'] = entity.agency_name;
  data['cur_amt'] = entity.cur_amt;
  data['fiscal_year'] = entity.fiscal_year;

  return data;
}

ExpenditureProgressPageEntity $ExpenditureProgressPageEntityFromJson(
    Map<String, dynamic> json) {
  final ExpenditureProgressPageEntity pageEntity = ExpenditureProgressPageEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    pageEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    pageEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    pageEntity.current = current;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    pageEntity.pages = pages;
  }
  final List<ExpenditureProgressEntity>? records =
      jsonConvert.convert<List<ExpenditureProgressEntity>>(json['records']);
  if (records != null) {
    pageEntity.records = records;
  }
  return pageEntity;
}

Map<String, dynamic> $ExpenditureProgressPageEntityToJson(
    ExpenditureProgressPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['records'] = entity.records;
  data['pages'] = entity.pages;
  return data;
}
